package com.example.demo.mapper;


import com.example.demo.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    //学生登录,查询所有学生账号密码
    @Select("select * from user_stu")
    List<User> selectUser();

    //注册,insert新学生账户密码
    @Insert("insert into user_stu(account,password) values (#{account},#{password})")
    void save(User user);

    //企业登录,查询所有学生账号密码
    @Select("select * from user_company")
    List<User> selectUserCm();
    //企业注册,insert新企业账户密码
    @Insert("insert into user_company(account,password) values (#{account},#{password})")
    void saveCm(User user);

    //管理员登录,查询所有学生账号密码
    @Select("select * from user_admin")
    List<User> selectUserAd();
    //管理员注册,insert新管理员账户密码
    @Insert("insert into user_admin(account,password) values (#{account},#{password})")
    void saveAd(User user);
    //删除学生账户
    @Delete("delete from user_stu where account = #{account}")
    void deleteStu(String account);
    //删除公司账户
    @Delete("delete from user_company where account = #{account}")
    void deleteCompany(String account);

    //分页查询
}
